package com.hmp.recruit.admin.sys.role.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.hmp.recruit.admin.sys.role.dao.RoleDao;
import com.hmp.recruit.admin.sys.role.service.RoleService;
import com.hmp.recruit.admin.sys.role.vo.RoleVo;
import com.hmp.recruit.common.vo.Page;
import com.hmp.recruit.common.vo.SearchParam;


@Service
public class RoleServiceImpl implements RoleService {

	@Resource
	private RoleDao roleDao;
	
	@Override
	public Page<RoleVo> page(SearchParam sp) {
		List<RoleVo> items = roleDao.roleListPage(sp);
		return Page.create(items, sp.getStart(), sp.getLimit(), sp.getTotal());
	}

	@Override
	public RoleVo getById(String roleId) {
		return roleDao.getById(roleId);
	}

	@Override
	public void add(RoleVo role) {
		roleDao.add(role);
	}

}
